<div class="popup_add_cont">
    <h2><?php echo __('New Trainer')?></h2>   
    
﻿<?php if(isset($saved_successfully) && $saved_successfully){?>
    <div class="popup_success">
        <?php echo __('Saved successfully')?>
    </div>

<script type="text/javascript">
    setTimeout("fillDataAndClose();", 3000);
            
    function fillDataAndClose(){            
            window.opener.$("#<?php echo $rel_input;?>").append('<option value="<?php echo $new_obj->getId();?>"><?php echo $new_obj->getName();?></option>');            
            window.opener.$("#<?php echo $rel_input;?>").val(<?php echo $new_obj->getId();?>);            
            window.close();
    }
</script>
<?php }else{?>
<form action="<?php echo url_for('trainer/newPopup?rel_input='.$rel_input);?>" method="post">
<table>
    <?php echo $form;?>
    <tr>        
        <td><input type="submit" value="<?php echo __('Save')?>" /></td>
    </tr>
</table>
</form>    
<?php }?>
</div>